Here's what bash is about, including Bash's color code, Bash's four-class files, how variables are handled in bash, array variables, the shell's procedural programming language, and some simple scripting examples.One, bash color display rules (color
In bash shell, the handling of arrays is an error-prone place.Array:Variable: Stores the memory space of a single element;Array: A contiguous memory space that stores multiple elements;Array nameIndex: Numbering starting from 0, is a numeric
An array is a data structure that can be used to design algorithms more efficiently and easily for bash programming, which is described in detail in this chapter in the sections on arrays and strings.Array array definitionAn array is a contiguous
Ix. unfoldingThe expansion of the command line is done after splitting the word into words. There are seven types of expansion: curly brace expansion, wavy line expansion, parametric and variable expansion, command substitution, arithmetic expansion,
The technical skills here were originally from Google's "testing on the Toilet" (Tott). Here is a revised and amplified version. Script Security
All of my bash scripts start with the following lines:
#!/bin/bash
set-o nounset
set-o
Iii. Command HistoryBash has absorbed a lot of essence from the Korn shell and the C shell, one of which formally holds the feature of a cached copy of the executed command, which we call the "command history" feature.Why should we use the command
Bash's color display rules:ASCII encoding is set for color:\033:ctrl Key[: Control the spacing character between character and color code0m: command to turn off color properties;1m: Bold for display text characters4m: Multibyte underline for text
Shell Features--Linux has a variety of shells to use, the default for Bash,bash has the following key features.1. Command Memory AbilityPress the up and down keys on the command line to find a pre/Post input command. These commands are recorded in ~/
Script Security
All of my bash scripts start with the following lines:
The code is as follows
Copy Code
#!/bin/bashSet-o NounsetSet-o Errexit
Doing so avoids two common problems:
Reference to an undefined
Bash programming arrays and string handlingDirectoryNote Date 20180405ArrayFame (Create) array declare-a array_nameAssignment of array elements array_name= ("VAL1" "VAL2" "VAL3" ...)Referencing an array element: ${array_name[index]}Bash's string
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.